Skip to content

BUG: fix the value error when using read_csv with "," as decimal point and pd.Float64Dtype() #52696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

hxy450
Copy link

@hxy450 hxy450 commented Apr 17, 2023

@@ -1201,6 +1201,9 @@ cdef class TextReader:
result, dtype=dtype, true_values=true_values,
false_values=false_values)
else:
if chr(self.parser.decimal) != ".":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This costs to much performance, I think that we have to fix this somewhere else

@hxy450
Copy link
Author

hxy450 commented Apr 18, 2023

This is my first contribution so I'm still trying to find my feet.
The current problem is after this function passes the array containing strings to _from_sequence_of_strings(), we lose track of what decimal point we should use. As a result, a latter function floatify() cannot parse the string correctly since they are trying to parse the string with ".". Is it ok if I add additional parameters to all the following functions to indicate this decimal point? Or is that inefficient too?

@phofl
Copy link
Member

phofl commented Apr 19, 2023

This needs restructuring of the casting logic. This is non-trivial.

@mroeschke
Copy link
Member

Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.

@mroeschke mroeschke closed this May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: support decimal keyword for Float64Dtype in read_csv
3 participants